package com.sugon.springboot.config;


import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class GatewayConfig {
    @Bean
    public RouteLocator customRouteLocator(RouteLocatorBuilder routeLocatorBuilder) {
        RouteLocatorBuilder.Builder routes = routeLocatorBuilder.routes();
        //把http://news.baidu.com/guonei映射到9527/guonei
        routes.route("path_rote_atguigu", r -> r.path("/artist").uri("https://music.91q.com/artist")).build();
        return routes.build();
    }
}

